﻿using Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ComponentModel;
using AnesSystem.Models;
using AnesSystem.Services;

namespace AnesSystem.ViewModels
{
    public class BaseViewModel<T> : ViewModel
    {
        #region Variables

        private static T _instance;

        private bool editDept = false;

        #endregion

        #region Constructor
        public BaseViewModel()
        {

        }

        #endregion

        #region Properties

        public static T Instance
        {
            get
            {
                if (_instance == null)
                {
                    _instance = Activator.CreateInstance<T>();
                }
                return _instance;
            }
        }

        public bool EditDept
        {
            get
            {
                return editDept;
            }

            set
            {
                editDept = value;

                RaisePropertyChanged("EditDept");
            }
        }

        #endregion

        #region 依赖属性

        #endregion

        #region Event

        #endregion

        #region Private Methods

        #endregion

        #region Public/Protected Methods

        public virtual void Refresh()
        {
           
        }

        #endregion

        #region EventHandlers
        #endregion

    }
}
